package dd.model;

import client.ServerAccess;
import dd.view.AdminScreen;
import dd.view.CreateForm;
import dd.view.MainScreen;
import dd.view.ModeratorAddChoices;
import dd.view.ResultScreen;
import dd.view.SignInScreen;
import dd.view.addChoiceScreen;
import dd.view.addEdgeFrame;

/**
 * the place record all local information, I use it as a global thing save many screens for further use for example for
 * dispose a screen save the ServerAccess to send a message
 */
public class Model {

	Event event;
	SignInScreen sins;
	CreateForm cf;
	addChoiceScreen acs;
	ModeratorAddChoices mac;
	addEdgeFrame aef;
	MainScreen mainScreen;
	AdminScreen adminScreen;
	ResultScreen resultScreen;

	static Model instance = null;
	/** Connection to server. */
	ServerAccess access;

	private Model() {

	}

	public static Model getInstance() {
		if (instance == null) {
			instance = new Model();
		}

		return instance;
	}

	public void setEvent(Event e) {
		this.event = e;
	}

	public Event getEvent() {
		return event;
	}

	/** Return the server access object. */
	public ServerAccess getServerAccess() {
		return access;
	}

	/** Application needs to know the access object for contacting server. */
	public void setServerAccess(ServerAccess sa) {
		this.access = sa;
	}

	public void setSignInScreen(SignInScreen sis) {
		this.sins = sis;
	}

	public SignInScreen getSignInScreen() {
		return sins;
	}

	public void setCreateForm(CreateForm cff) {
		this.cf = cff;
	}

	public CreateForm getCreateForm() {
		return cf;
	}

	public void setaddChoiceScreen(addChoiceScreen ac) {
		this.acs = ac;
	}

	public addChoiceScreen getaddAddChoiceScreen() {
		return acs;
	}

	public void setmac(ModeratorAddChoices macc) {
		this.mac = macc;
	}

	public ModeratorAddChoices getmac() {
		return mac;
	}

	public addEdgeFrame getaef() {
		return aef;
	}

	public void setaef(addEdgeFrame aef) {
		this.aef = aef;
	}

	public MainScreen getMainScreen() {
		return mainScreen;
	}

	public void setMainScreen(MainScreen mainScreen) {
		this.mainScreen = mainScreen;
	}

	public AdminScreen getAdminScreen() {
		return adminScreen;
	}

	public void setAdminScreen(AdminScreen adminScreen) {
		this.adminScreen = adminScreen;
	}

	public ResultScreen getResultScreen() {
		return resultScreen;
	}

	public void setResultScreen(ResultScreen resultScreen) {
		this.resultScreen = resultScreen;
	}

}
